<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\index\controller;

use think\admin\Controller;
use app\index\service\wechat\Message as MessageService;

/**
 * Class Index
 * @package app\index\controller
 */
class Index extends Controller
{
    public function index()
    {
        $this->fetch();
    }
    
    public function wap()
    {
    	$this->fetch();
    }
    
    public function send()
    {
        $postData = $this->request->post();
        if (empty($postData['brand']) || empty($postData['contact']) || empty($postData['explain']) ) {
            $this->error("有参数为空，请正确填写");
        }
        $sendData = "合作品牌：".$postData['brand']."\n"."联系方式：".$postData['contact']."\n"."合作说明：".$postData['explain'];
        $model = new MessageService();
        if ($model->send($sendData, 'jiang','@all', '@all')) {
            $this->success("提交成功");
        }
        
    }
    
}